 <script lang="ts" setup>
	import { ref, onMounted } from 'vue'
	import { getAllArticlesBytnId } from "@/api/article.js"
	// import mpHtml from 'mp-html/dist/uni-app/components/mp-html/mp-html'


	const props = defineProps({
		id: {
			type: [Number, String],
			default: ''
		},
	})

	let content = ref();
	const tenantId = ref('')
	const getAll = () => {
		let data = {
			id: props.id,
			tenantId: tenantId.value
		}
		getAllArticlesBytnId(data).then(res => {
			if (res.data.code == 200) {
				
				content.value = res.data.data.records[0].content;
				
			}
		}).catch(error => {
			console.log(error)
		})
	}
	onMounted(() => {
		console.log("id", props.id)
		tenantId.value = uni.getStorageSync('tenantId')
		getAll();

	});
	const scrollTop = 0;
	const timer = ref(null)
	const handleEnd = () => {
		timer.value.resetTime()
	}
 </script>

 <template>
	 <articleTable ref="timer"></articleTable>
 	<img :src="'@/../static/img/bgIcon/article.svg'"
 		style="opacity: 0.3;width: 45%;position: absolute;top: 50%;right: -3%;" />
 	<view @touchend="handleEnd" class="wh100p "
 		style="justify-content: center; align-items: center;background: linear-gradient(90deg, #0078BB 0%, #003E94 100%);">
 		<Navigator :fixed="true" background-color="transparent" status-bar left-icon="back" left-text="返回" title="文章"
 			style="height: 3vh;">
 		</Navigator>
 		<scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y"
 			style="padding: 20rpx;width: 100%;w100p flex-column;padding:2% 6%;box-sizing: border-box; height: 95%;">
 			<u-parse :content="content" class="cust" style="color:white;font-size:28px;line-height:48px" />
 		</scroll-view>

 	</view>
 </template>


 <style>
 	.cust:first-child {
 		/* display: flex; */
 		/* width: 100%; */
 		/* background-color: red; */
 	}

 	.scroll-Y {
 		height: 97vh;
 	}

 	.scroll-view_H {
 		white-space: nowrap;
 		width: 100%;
 	}

 	.scroll-view-item {
 		height: 100vh;
 		line-height: 300rpx;
 		text-align: center;
 		font-size: 36rpx;
 	}

 	.scroll-view-item_H {
 		display: inline-block;
 		width: 100%;
 		height: 300rpx;
 		line-height: 300rpx;
 		text-align: center;
 		font-size: 36rpx;
 	}
 </style>